package com.guonl.feign;

//import com.guonl.config.OpenApiFeignConfiguration;
import com.guonl.feign.auth.Auth;
import com.guonl.feign.interceptor.OpenApiRequestInterceptor;
import com.guonl.feign.model.UserInfo;
import com.guonl.model.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "guonl-springcloud-open-api", configuration = OpenApiRequestInterceptor.class)
public interface OpenApiFeign {
    @GetMapping("/openapi/getTest1")
    ResponseResult getTest1(@RequestParam("name") String name, @RequestParam("age") Integer age, @RequestParam("phone") String phone, @Auth long userId);

    @GetMapping("/openapi/getTest2")
    ResponseResult getTest2(UserInfo userInfo, @Auth long userId);

    @PostMapping("/openapi/postTest1")
    ResponseResult postTest1(UserInfo userInfo, @Auth long userId);

    @PostMapping("/openapi/postTest2")
    ResponseResult postTest2(@RequestBody UserInfo userInfo, @Auth long userId);

}
